Long ago, before we had file monitoring at the GIO/Glib level, we would
reload the current folder each time a file chooser gets (re)mapped.
This was basically to let the GIMP recycle the same file chooser for all
file/open or file/save operations, instead of creating a new one every time.
In that case, we reloaded the folder with each ::map() event so that the
file chooser would present an up-to-date view of the folder that was being
displayed. Now, the folder should always be up-to-date as we do
file monitoring all the time.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
*/
break;
- case RELOAD_WAS_UNMAPPED:
- /* Just reload the current folder; else continue
- * the pending load.
- */
- if (impl->current_folder)
- {
- pending_select_files_store_selection (impl);
- change_folder_and_display_error (impl, impl->current_folder, FALSE);
- }
- break;
-
default:
g_assert_not_reached ();
}
settings_save (impl);
GTK_WIDGET_CLASS (_gtk_file_chooser_default_parent_class)->unmap (widget);
-
- impl->reload_state = RELOAD_WAS_UNMAPPED;
}
static void
typedef enum {
RELOAD_EMPTY, /* No folder has been set */
- RELOAD_HAS_FOLDER, /* We have a folder, although it may not be completely loaded yet; no need to reload */
- RELOAD_WAS_UNMAPPED /* We had a folder but got unmapped; reload is needed */
+ RELOAD_HAS_FOLDER /* We have a folder, although it may not be completely loaded yet; no need to reload */
} ReloadState;
typedef enum {
passed = passed && (impl->current_folder != NULL
&& impl->browse_files_model != NULL
&& (impl->load_state == LOAD_PRELOAD || impl->load_state == LOAD_LOADING || impl->load_state == LOAD_FINISHED)
- && impl->reload_state == RELOAD_WAS_UNMAPPED
&& (impl->load_state == LOAD_PRELOAD ? (impl->load_timeout_id != 0) : TRUE)
&& ((impl->load_state == LOAD_LOADING || impl->load_state == LOAD_FINISHED)
? (impl->load_timeout_id == 0 && impl->sort_model != NULL)